<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\User;
use Illuminate\Support\Facades\Hash;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        // 创建管理员用户
        User::create([
            'username' => 'admin',
            'password' => Hash::make('admin123'),
            'real_name' => '管理员',
            'email' => 'admin@example.com',
            'role' => 'admin'
        ]);

        // 创建教师用户
        User::create([
            'username' => 'teacher',
            'password' => Hash::make('teacher123'),
            'real_name' => '张老师',
            'email' => 'teacher@example.com',
            'role' => 'teacher'
        ]);

        // 创建学生用户
        User::create([
            'username' => 'student',
            'password' => Hash::make('student123'),
            'real_name' => '李同学',
            'email' => 'student@example.com',
            'role' => 'student'
        ]);
    }
}
